package com.bby.disk.manager.download;

import com.bby.disk.manager.virtual.VirtualFile;
import com.bby.disk.manager.virtual.VirtualObject;
import com.bby.disk.util.BBYFileSystem;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.File;
import java.io.Serializable;
import java.util.UUID;

@Data
@Accessors(chain = true)
public class DirectLinkObj implements Serializable {
    String md5;
    String id;
    String filename;
    String fileId;
    long lastModified;
    String tempFilePath;

    public DirectLinkObj() {
        id = UUID.randomUUID().toString();
    }
    public DirectLinkObj(VirtualFile file) {
        this();
        md5=file.getMd5();
        filename=file.getName();
        fileId=file.getId();
        lastModified=file.getLastModified().getTime();
    }

    public DirectLinkObj(String id, String filename, String tempFilePath) {
        this();
        this.id = id;
        this.filename = filename;
        this.tempFilePath = tempFilePath;
    }
}
